﻿@page "/"
@inherits IndexPage

@if (IsLoaded)
{
    @if (!Context.Install.IsInstalled)
    {
        <Known.AntBlazor.Pages.Install OnInstall="OnInstall" />
    }
    else if (!IsLogin)
    {
        <Known.Demo.Pages.Login OnLogin="OnLogin" />
    }
    else
    {
        <Known.AntBlazor.Pages.Admin OnLogout="OnLogout" />
    }
}

@code {
    // //第三方登录设置当前用户
    // protected override async Task OnAfterRenderAsync(bool firstRender)
    // {
    //    if (firstRender)
    //        await SetCurrentUserAsync(CurrentUser);
    //    await base.OnAfterRenderAsync(firstRender);
    // }

    // //第三方登录获取当前用户
    // protected override async Task<UserInfo> GetThirdUserAsync()
    // {
    //    //var third = ThirdApi.GetUser();
    //    var third = new { UserName = "admin" };
    //    var user = await Platform.GetUserAsync(third.UserName);
    //    return user;
    // }
}